using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

public class CameraLookAt : MonoBehaviour
{
    private Transform mCurTarget;
    public Transform mTarget1;
    public Transform mTarget2;

    private void Start()
    {
        mCurTarget = mTarget1;
        transform.DOLookAt(mCurTarget.position, 2);
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            if (mCurTarget.name == "cube1")
            {
                mCurTarget = mTarget2;
            }
            else
            {
                mCurTarget = mTarget1;
            }
            transform.DOLookAt(mCurTarget.position, 2);
        }
    }
}
